﻿<Window x:Class="DotNETX.Version.Manager.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:DotNETX.Version.Manager"
        DataContext="{DynamicResource ManagerViewModel}"
        Title="客户端版本升级管理程序" Height="350" Width="600" Icon="/DotNETX.Version.Manager;component/upload.ico">
    <Window.Resources>
        <local:ManagerViewModel x:Key="ManagerViewModel" />
        <local:BoolenRevertConverter x:Key="NotConverter" />
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="112" />
            <ColumnDefinition Width="466*" />
        </Grid.ColumnDefinitions>
        <Label Content="服务端：" Height="28" HorizontalAlignment="Right" Margin="0,16,6,0" Name="label1" VerticalAlignment="Top" />
        <TextBox IsReadOnly="True"  Height="23" Margin="0,16,12,0" VerticalAlignment="Top" Background="#FFD8D8D8" Grid.Column="1">
            <TextBox.Text>
                <MultiBinding StringFormat="{}Version={0}:{1}:{2} File={3}:{4}:{5}">
                    <Binding Path="VersionServiceProtocal" />
                    <Binding Path="VersionServiceIp"/>
                    <Binding Path="VersionServicePort"/>
                    <Binding Path="FileServiceProtocal"/>
                    <Binding Path="FileServiceIp"/>
                    <Binding Path="FileServicePort"/>
                </MultiBinding>
            </TextBox.Text>
        </TextBox>
        <Label Content="新版本号：" Height="28" HorizontalAlignment="Right" Margin="0,56,6,0" Name="label3" VerticalAlignment="Top" />
        <TextBox Text="{Binding NewVersion, Mode=TwoWay}" local:TextBoxFix.UpdateSourceOnTextChanged="True" IsEnabled="{Binding IsBusy, Converter={StaticResource NotConverter}}" Height="23" HorizontalAlignment="Left" Margin="0,56,0,0" Name="textBox3" VerticalAlignment="Top" Width="120" Grid.Column="1" />
        <Label Content="当前版本号：" Height="28" HorizontalAlignment="Right" Margin="0,56,138,0" Name="label5" VerticalAlignment="Top" Grid.Column="1" />
        <TextBox Text="{Binding CurrentVersion, Mode=TwoWay}" IsReadOnly="True" Height="23" HorizontalAlignment="Right" Margin="0,56,12,0" Name="textBox5" VerticalAlignment="Top" Width="120" Background="#FFD8D8D8" Grid.Column="1" />
        <Label Content="描述：" Height="28" HorizontalAlignment="Right" Margin="0,98,6,0" Name="label4" VerticalAlignment="Top" />
        <TextBox Text="{Binding Description, Mode=TwoWay}" local:TextBoxFix.UpdateSourceOnTextChanged="True" IsEnabled="{Binding IsBusy, Converter={StaticResource NotConverter}}" Margin="0,98,12,110" Name="textBox4" Grid.Column="1" />
        <Label Content="升级文件目录：" Height="28" HorizontalAlignment="Right" Margin="0,0,6,62" Name="label2" VerticalAlignment="Bottom" />
        <TextBox Text="{Binding UpgradeFilesDirectory, Mode=TwoWay}" local:TextBoxFix.UpdateSourceOnTextChanged="True" IsEnabled="{Binding IsBusy, Converter={StaticResource NotConverter}}" Height="23" Margin="0,0,50,67" Name="textBox2" VerticalAlignment="Bottom" Grid.Column="1" />
        <Button Command="{Binding OpenUpgradDirectoryCommand}" Content="..." Height="23" HorizontalAlignment="Right" Margin="0,0,12,67" Name="button2" VerticalAlignment="Bottom" Width="32" Grid.Column="1" />
        <Label Content="{Binding Msg}" Height="28" HorizontalAlignment="Right" Margin="0,0,6,28" VerticalAlignment="Bottom" />
        <ProgressBar Value="{Binding Progress}" Height="10" Margin="0,0,12,38" VerticalAlignment="Bottom" Grid.Column="1" />
        <Button Content="更新版本" Command="{Binding DoUpgradeCommand}" Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" VerticalAlignment="Bottom" Width="75" Grid.Column="1" />
    </Grid>
</Window>
